function selectTR(trname,trcount,url)
{
	for (i=1;i<=trcount;i++)
	{
	document.all["tr"+i].style.backgroundColor="";
	}
	
	trname.style.backgroundColor="#C8D7E3";
	parent.main.location.href=url;
	
}

var isSelected = false ;
function select_all_checkbox(form,chk_name)
{
    if(!isSelected)
	{
    	//
        select_all_checkbox_handler(form, chk_name, true);
        isSelected = true ;
    }
    else
	{
        if(isSelected)
		{
        	//
            select_all_checkbox_handler(form, chk_name, false);
            isSelected =false ;
        }
    }
}



function select_all_checkbox_handler(form,chk_name,isSelected)
{
	for(var i=0; i<form.elements.length; i++)
	{
		if(form.elements[i].name == chk_name)
		{
			form.elements[i].checked = isSelected ;
		}
	}
}

function selectCheckedID(form,chk_name)
{
	var itemIDs = "";

	for(var i=0; i<form.elements.length; i++)
	{
		if(form.elements[i].name == chk_name && form.elements[i].checked == true)
		{
			if (itemIDs == "") itemIDs = itemIDs + form.elements[i].value;
						 else  itemIDs = itemIDs + "," + form.elements[i].value;
		}
	}

	return itemIDs;
}

function selectCheckedIDString(form,chk_name)
{
	var itemIDs = "";

	for(var i=0; i<form.elements.length; i++)
	{
		if(form.elements[i].name == chk_name && form.elements[i].checked == true)
		{
			if (itemIDs == "") itemIDs = itemIDs + "'" + form.elements[i].value + "'";
						 else  itemIDs = itemIDs + "," + "'" + form.elements[i].value + "'";
		}
	}

	return itemIDs;
}


function selectDoubleCheckedID(form,chk_name)
{
	var itemIDs = "";
	var iCount = 0;
	for(var i=0; i<form.elements.length; i++)
	{
		if(form.elements[i].name == chk_name && form.elements[i].checked == true)
		{
			if (itemIDs == "")
			{
				itemIDs = itemIDs + form.elements[i].value;
			}
			else
			{
				itemIDs = itemIDs + "," + form.elements[i].value;
			}
			iCount ++;
		}
	}
	if (iCount!=2) return "";
	return itemIDs;
}

